#include "gofgame/dungeonkeeper/unitmanagerscene/UnitManagerScene.h"
#include "gofgame/common/ui/UIShellLayer.h"
#include "gofgame/common/ui/TypedIntent.h"
#include "gofgame/dungeonkeeper/ui/StrategicOperationView.h"
#include "gofgame/dungeonkeeper/ui/ChoiceUnitDialog.h"
#include "gofgame/common/graphics/HornedTextureBrush.h"
#include "gofgame/common/graphics/LinearGradientBrush.h"
#include "gofgame/common/ui/DockLayout.h"
#include "gofgame/common/ui/DockLayoutData.h"
#include "gofgame/dungeonkeeper/unitmanagerscene/UnitManagerView.h"

using namespace gofgame::dungeonkeeper::unitmanagerscene;
using namespace gofgame::dungeonkeeper::game;
using namespace gofgame::dungeonkeeper::configuration;
using namespace gofgame::common::ui;
using namespace gofgame::dungeonkeeper::ui;

bool UnitManagerScene::init(){
	bool bRet = false;
	do 
	{
		CC_BREAK_IF(!CCScene::init());

		CCSize size = CCDirector::sharedDirector()->getWinSize();

		CCLayer *bgLayer = CCLayer::create();
		CCSprite *bgSprite = CCSprite::create("ui/unitmanagerbg.png");
		bgLayer->addChild(bgSprite);
		bgSprite->setPosition(ccp(size.width * 0.5,size.height * 0.5));
		this->addChild(bgLayer);

		UIShellLayer::getUIShellLayer(this)->forward(new TypedIntent<UnitManagerView>());

		Ref<Dialog> dialog;
		dialog.initialize(new ChoiceUnitDialog());
		dialog->init();
		dialog->show(this);

		bRet = true;
	} while (0);
	return bRet;
}

